With it, remove window->visual.
gdk_window_get_window_type
gdk_window_get_display
gdk_window_get_screen
-gdk_window_get_visual
gdk_window_show
gdk_window_show_unraised
gdk_window_hide
window = broadway_screen->root_window;
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_BROADWAY, NULL);
window->impl_window = window;
- window->visual = gdk_screen_get_system_visual (screen);
impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
GdkWindow *parent;
GdkWindow *transient_for;
- GdkVisual *visual;
gpointer user_data;
return NULL;
}
- window->visual = gdk_screen_get_rgba_visual (screen);
- if (window->visual == NULL)
- window->visual = gdk_screen_get_system_visual (screen);
-
window->event_mask = attributes->event_mask;
if (attributes->wclass == GDK_INPUT_OUTPUT)
return GDK_WINDOW_TYPE (window);
}
-/**
- * gdk_window_get_visual:
- * @window: a #GdkWindow
- *
- * Gets the #GdkVisual describing the pixel format of @window.
- *
- * Returns: (transfer none): a #GdkVisual
- *
- * Since: 2.24
- **/
-GdkVisual*
-gdk_window_get_visual (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- return window->visual;
-}
-
/**
* gdk_window_get_screen:
* @window: a #GdkWindow
{
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- return gdk_visual_get_screen (window->visual);
+ return gdk_display_get_default_screen (window->display);
}
/**
* @height: height of window
* @wclass: #GDK_INPUT_OUTPUT (normal window) or #GDK_INPUT_ONLY (invisible
* window that receives events)
- * @visual: #GdkVisual for window
* @window_type: type of window
* @cursor: cursor for the window (see gdk_window_set_cursor())
* @override_redirect: %TRUE to bypass the window manager
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_is_destroyed (GdkWindow *window);
-GDK_AVAILABLE_IN_ALL
-GdkVisual * gdk_window_get_visual (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GdkScreen * gdk_window_get_screen (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
{
GdkDisplay *display = gdk_window_get_display (window);
EGLDisplay *egl_display = _gdk_mir_display_get_egl_display (display);
- GdkVisual *visual = gdk_window_get_visual (window);
EGLint attrs[MAX_EGL_ATTRS];
EGLint count;
EGLConfig *configs;
- gboolean use_rgba;
int i = 0;
attrs[i++] = 1;
attrs[i++] = EGL_BLUE_SIZE;
attrs[i++] = 1;
-
- use_rgba = (visual == gdk_screen_get_rgba_visual (gdk_display_get_default_screen (display)));
-
- if (use_rgba)
- {
- attrs[i++] = EGL_ALPHA_SIZE;
- attrs[i++] = 1;
- }
- else
- {
- attrs[i++] = EGL_ALPHA_SIZE;
- attrs[i++] = 0;
- }
+ attrs[i++] = EGL_ALPHA_SIZE;
+ attrs[i++] = 1;
attrs[i++] = EGL_NONE;
g_assert (i < MAX_EGL_ATTRS);
if (GDK_WINDOW_DESTROYED (gdk_window))
return YES;
- /* A view is opaque if its GdkWindow doesn't have the RGBA visual */
- return gdk_window_get_visual (gdk_window) !=
- gdk_screen_get_rgba_visual (_gdk_screen);
+ return NO;
}
-(void)drawRect: (NSRect)rect
gdk_window_set_title (window, title);
- if (gdk_window_get_visual (window) == gdk_screen_get_rgba_visual (_gdk_screen))
- {
- [impl->toplevel setOpaque:NO];
- [impl->toplevel setBackgroundColor:[NSColor clearColor]];
- }
+ [impl->toplevel setOpaque:NO];
+ [impl->toplevel setBackgroundColor:[NSColor clearColor]];
content_rect.origin.x = 0;
content_rect.origin.y = 0;
{
GdkDisplay *display = gdk_window_get_display (window);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
- GdkVisual *visual = gdk_window_get_visual (window);
EGLint attrs[MAX_EGL_ATTRS];
EGLint count;
EGLConfig *configs;
- gboolean use_rgba;
-
int i = 0;
attrs[i++] = EGL_SURFACE_TYPE;
attrs[i++] = 1;
attrs[i++] = EGL_BLUE_SIZE;
attrs[i++] = 1;
-
- use_rgba = (visual == gdk_screen_get_rgba_visual (gdk_display_get_default_screen (display)));
-
- if (use_rgba)
- {
- attrs[i++] = EGL_ALPHA_SIZE;
- attrs[i++] = 1;
- }
- else
- {
- attrs[i++] = EGL_ALPHA_SIZE;
- attrs[i++] = 0;
- }
+ attrs[i++] = EGL_ALPHA_SIZE;
+ attrs[i++] = 1;
attrs[i++] = EGL_NONE;
g_assert (i < MAX_EGL_ATTRS);
window = _gdk_display_create_window (GDK_DISPLAY (display_wayland));
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WAYLAND, NULL);
window->impl_window = window;
- window->visual = gdk_screen_get_system_visual (screen);
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
static gint
_get_wgl_pfd (HDC hdc,
- const gboolean need_alpha_bits,
PIXELFORMATDESCRIPTOR *pfd)
{
gint best_pf = 0;
best_pf = ChoosePixelFormat (hdc, pfd);
- if (best_pf == 0)
- /* give another chance if need_alpha_bits is FALSE,
- * meaning we prefer to have an alpha channel anyways
- */
- if (!need_alpha_bits)
- {
- pfd->cAlphaBits = 0;
- best_pf = ChoosePixelFormat (hdc, pfd);
- }
-
return best_pf;
}
* one and cache it for later use
*/
static gint
-_gdk_init_dummy_context (GdkWGLDummy *dummy,
- const gboolean need_alpha_bits)
+_gdk_init_dummy_context (GdkWGLDummy *dummy)
{
PIXELFORMATDESCRIPTOR pfd;
gboolean set_pixel_format_result = FALSE;
dummy->hdc = GetDC (dummy->hwnd);
memset (&pfd, 0, sizeof (PIXELFORMATDESCRIPTOR));
- best_idx = _get_wgl_pfd (dummy->hdc, need_alpha_bits, &pfd);
+ best_idx = _get_wgl_pfd (dummy->hdc, &pfd);
if (best_idx != 0)
set_pixel_format_result = SetPixelFormat (dummy->hdc,
}
gboolean
-_gdk_win32_display_init_gl (GdkDisplay *display,
- const gboolean need_alpha_bits)
+_gdk_win32_display_init_gl (GdkDisplay *display)
{
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (display);
gint best_idx = 0;
* dummy GL Context, it is used to query functions
* and used for other stuff as well
*/
- best_idx = _gdk_init_dummy_context (&dummy, need_alpha_bits);
+ best_idx = _gdk_init_dummy_context (&dummy);
if (best_idx == 0 || !wglMakeCurrent (dummy.hdc, dummy.hglrc))
return FALSE;
GdkDisplay *display = gdk_window_get_display (window);
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (gdk_window_get_display (window));
GdkWin32GLContext *context = NULL;
- GdkVisual *visual = gdk_window_get_visual (window);
-
- gboolean need_alpha_bits = (visual == gdk_screen_get_rgba_visual (gdk_display_get_default_screen (display)));
/* Acquire and store up the Windows-specific HWND and HDC */
HWND hwnd;
HDC hdc;
- if (!_gdk_win32_display_init_gl (display, need_alpha_bits))
+ if (!_gdk_win32_display_init_gl (display))
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
"shared-context", share,
NULL);
- context->need_alpha_bits = need_alpha_bits;
context->gl_hdc = hdc;
context->is_attached = attached;
if (!GDK_IS_WIN32_DISPLAY (display))
return FALSE;
- if (!_gdk_win32_display_init_gl (display, FALSE))
+ if (!_gdk_win32_display_init_gl (display))
return FALSE;
if (major != NULL)
{
g_return_val_if_fail (GDK_IS_WINDOW (d), NULL);
- return static_printf ("%s:%p:%dx%dx%d",
+ return static_printf ("%s:%p:%dx%d",
G_OBJECT_TYPE_NAME (d),
GDK_WINDOW_HWND (d),
gdk_window_get_width (GDK_WINDOW (d)),
- gdk_window_get_height (GDK_WINDOW (d)),
- gdk_visual_get_depth (gdk_window_get_visual (GDK_WINDOW (d))));
+ gdk_window_get_height (GDK_WINDOW (d)));
}
#endif /* G_ENABLE_DEBUG */
if (height)
*height = rect.bottom - rect.top;
- GDK_NOTE (MISC, g_print ("gdk_win32_window_get_geometry: %p: %ldx%ldx%d@%+ld%+ld\n",
+ GDK_NOTE (MISC, g_print ("gdk_win32_window_get_geometry: %p: %ldx%ld@%+ld%+ld\n",
GDK_WINDOW_HWND (window),
rect.right - rect.left, rect.bottom - rect.top,
- gdk_window_get_visual (window)->depth,
rect.left, rect.top));
}
}
return NULL;
}
+GdkVisual *
+gdk_x11_display_get_window_visual (GdkX11Display *display)
+{
+ GdkScreen *screen;
+ GdkVisual *visual;
+
+ screen = gdk_display_get_default_screen (GDK_DISPLAY (display));
+
+ visual = gdk_screen_get_rgba_visual (screen);
+ if (visual == NULL)
+ visual = gdk_screen_get_system_visual (screen);
+
+ return visual;
+}
+
static void
gdk_x11_display_class_init (GdkX11DisplayClass * class)
{
#include "gdkglcontext-x11.h"
#include "gdkdisplay-x11.h"
+#include "gdkprivate-x11.h"
#include "gdkscreen-x11.h"
#include "gdkx11display.h"
return NULL;
}
- visual = gdk_window_get_visual (window);
+ visual = gdk_x11_display_get_window_visual (GDK_X11_DISPLAY (display));
if (!find_fbconfig_for_visual (display, visual, &config, error))
return NULL;
GList * _gdk_x11_screen_list_visuals (GdkScreen *screen);
+GdkVisual * gdk_x11_display_get_window_visual (GdkX11Display *display);
void _gdk_x11_display_add_window (GdkDisplay *display,
XID *xid,
{
GdkVisual *visual;
- visual = gdk_window_get_visual (impl->wrapper);
+ visual = gdk_x11_display_get_window_visual (GDK_X11_DISPLAY (gdk_window_get_display (impl->wrapper)));
return cairo_xlib_surface_create (GDK_WINDOW_XDISPLAY (impl->wrapper),
GDK_WINDOW_IMPL_X11 (impl)->xid,
GDK_VISUAL_XVISUAL (visual),
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
window->impl_window = window;
- window->visual = gdk_screen_get_system_visual (screen);
impl = GDK_WINDOW_IMPL_X11 (window->impl);
GdkWindowImplX11 *impl;
GdkX11Screen *x11_screen;
GdkX11Display *display_x11;
+ GdkVisual *visual;
Window xparent;
Visual *xvisual;
xattributes_mask = 0;
- xvisual = gdk_x11_visual_get_xvisual (window->visual);
+ visual = gdk_x11_display_get_window_visual (display_x11);
+ xvisual = gdk_x11_visual_get_xvisual (visual);
if (attributes_mask & GDK_WA_NOREDIR)
{
xattributes.bit_gravity = NorthWestGravity;
xattributes_mask |= CWBitGravity;
- xattributes.colormap = _gdk_visual_get_x11_colormap (window->visual);
+ xattributes.colormap = _gdk_visual_get_x11_colormap (visual);
xattributes_mask |= CWColormap;
if (window->window_type == GDK_WINDOW_TEMP)
win = _gdk_display_create_window (display);
win->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
win->impl_window = win;
- win->visual = gdk_x11_screen_lookup_visual (screen,
- XVisualIDFromVisual (attrs.visual));
impl = GDK_WINDOW_IMPL_X11 (win->impl);
impl->wrapper = win;